#***********************************************************************************
#* Code license:  GNU General Public License v3                                    *
#* Main page:     https://code.google.com/p/library-cross-platform/                *
#* Issue tracker: https://code.google.com/p/library-cross-platform/issues/list     *
#***********************************************************************************

platform ?= linux

include include.mk

INCLUDES = -I$(HOME_DIR)

include $(HOME_DIR)/target.mk
include $(PARSER_DIR)/parser.mk

CP_LIB_HOME = $(HOME_DIR)

CP_LIB_INCLUDE = -I$(CP_LIB_HOME) -I$(HOME_DIR) -I$(PARSER_DIR)


CP_LIB_C_FILES =
CP_LIB_CC_FILES =
CP_LIB_CPP_FILES =                   \
    $(CP_LIB_HOME)math_x.cpp         \
    $(CP_LIB_HOME)hash.cpp           \
    $(CP_LIB_HOME)bits.cpp           \


ifeq ($(platform), linux)
  CP_LIB_C_FILES   +=
  CP_LIB_CC_FILES  +=
  CP_LIB_CPP_FILES +=

endif

ifeq ($(platform), win)
  CP_LIB_C_FILES   +=
  CP_LIB_CC_FILES  +=
  CP_LIB_CPP_FILES +=    

endif

OBJECTS_CP_LIB := $(CP_LIB_C_FILES:.c=_$(target).o) $(CP_LIB_CC_FILES:.cc=_$(target).o) $(CP_LIB_CPP_FILES:.cpp=_$(target).o)




all:


cplib_compile: $(OBJECTS_CP_LIB) parser_compile


.PHONY : cplib_clean
cplib_clean: parser_clean
	\rm -rf $(OBJECTS_CP_LIB) *.o


%_$(target).o: %.cpp
	$(CC) $(DEBUG) $(CFLAGS) $(DEFINE) $(CP_LIB_INCLUDE) -o $@ -c $<

%_$(target).o: %.c
	$(CC) $(DEBUG) $(CFLAGS) $(DEFINE) $(CP_LIB_INCLUDE) -o $@ $<

%_$(target).o: %.cc
	$(CC) $(DEBUG) $(CFLAGS) $(DEFINE) $(CP_LIB_INCLUDE) -o $@ $<

